package com.yonyou.pmclouds.workquality.mapper;

import com.yonyou.pmclouds.basecom.dao.BaseMapper;
import com.yonyou.pmclouds.workquality.entity.WorkqualityDetailVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Set;

public interface WorkqualityDetailMapper extends BaseMapper<WorkqualityDetailVO> {

    @Select("select * from pmbd_workqualitydetail where pk_workquality = #{pk}  and dr=0 order by checkcode asc ")
    @ResultMap("getMap")
    List<WorkqualityDetailVO> queryByWorkqualityId(@Param("pk") String pks);

    @Select("select * from pmbd_workqualitydetail where pk_workquality in (${pks})  and dr=0 order by checkcode asc")
    @ResultMap("getMap")
    List<WorkqualityDetailVO> queryByWorkqualityIds(@Param("pks") String pks);

    WorkqualityDetailVO queryById(@Param("id") String id);

    WorkqualityDetailVO[] queryByPks(@Param("pks") String[] pks);

    WorkqualityDetailVO[] queryByProcedureCode(@Param("pkTenant") String pkTenant,
                                               @Param("procedureCode") String procedureCode);

    List<WorkqualityDetailVO> queryDetailByPkQualities(@Param("set") Set<Set<String>> pkWorkQualities);

    /**
     * 查询检查标准下启用状态的检查项
     *
     * @param pk
     * @return
     */
    List<WorkqualityDetailVO> queryEnableItemByWorkqualityId(@Param("pk") String pk);
}
